/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-09-24
**/
@Entity
@Data
@Table(name="identity_item")
public class IdentityItem implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "item_id")
    @ApiModelProperty(value = "主键")
    private Long itemId;

    @Column(name = "item_no")
    @ApiModelProperty(value = "编号")
    private String itemNo;

    @Column(name = "title")
    @ApiModelProperty(value = "标题")
    private String title;

    @Column(name = "sub_title")
    @ApiModelProperty(value = "副标题")
    private String subTitle;

    @Column(name = "item_pic")
    @ApiModelProperty(value = "图片")
    private String itemPic;

    @Column(name = "sale_price")
    @ApiModelProperty(value = "售价")
    private BigDecimal salePrice;

    @Column(name = "discount_price")
    @ApiModelProperty(value = "折扣价")
    private BigDecimal discountPrice;

    @Column(name = "item_desc")
    @ApiModelProperty(value = "介绍")
    private String itemDesc;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "createby")
    @ApiModelProperty(value = "创建人")
    private String createby;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "updateby")
    @ApiModelProperty(value = "更新人")
    private String updateby;

    @Column(name = "status")
    @ApiModelProperty(value = "状态，0：无效，1：有效，-1:删除")
    private Integer status;

    @Column(name = "one_level_ratio")
    @ApiModelProperty(value = "一级分润")
    private BigDecimal oneLevelRatio;

    @Column(name = "two_level_ratio")
    @ApiModelProperty(value = "二级分润")
    private BigDecimal twoLevelRatio;

    @Column(name = "ticket_num")
    @ApiModelProperty(value = "门票数量")
    private Integer ticketNum;

    @Column(name = "admin_mobile")
    @ApiModelProperty(value = "管理员手机号")
    private String adminMobile;

    @Column(name = "admin_openid")
    @ApiModelProperty(value = "管理员openId")
    private String adminOpenid;

    @Column(name = "show_index")
    @ApiModelProperty(value = "是否展示在页面0：不展示，1：展示")
    private Integer showIndex;


    public void copy(IdentityItem source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}